// V1rU5's anticamp
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;

doAntiCamp()
{
	// level waittill( "prematch_over" );
	self endon( "disconnect" );
	self endon( "death" );

	camp_time2 = 5;
	camp_time = 0;	
	max_distance = 80;
	

	for( ;; )
	{
		old_position = self.origin;
		wait 1;
		
		new_position = self.origin;
		distance = distance2d( old_position, new_position );
		
		if (distance < max_distance)
			camp_time++;
			
		else
		{
			camp_time = 0;
		}
		
		if (camp_time == camp_time2)
		{
			self IprintLn( "Please stop camping, ^110 ^7seconds to move!" );
		}
		
		if (camp_time == ( camp_time2 + 5 ))
		{
			self IprintLn( "Please stop camping, ^15 ^7seconds to move!" );
		}
		
		if (camp_time == ( camp_time2 + 8 ))
		{
			self IprintLn( "Please stop camping, ^12 ^7seconds to move!" );
		}
		
		if (camp_time == ( camp_time2 + 10 ))
		{
			self IprintLn( "You have been killed for camping!" );
			self suicide();
		}
	}
}

/*
doKick()
{
	playernumber = self thread getPlayerByNum(pNum);
	kick ( playernumber );
}

getPlayerByNum( pNum ) 
{
	players = level.players;
	
	for ( i = 0; i < players.size; i++ )
		if ( players[i] getEntityNumber() == pNum ) 
			return players[i];
}
*/